/**
 * Copyright 2005 Cordys R&D B.V. 
 * 
 * This file is part of the Cordys MB Violation Detector. 
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
 package com.cordys.tools.mb;

import java.util.ArrayList;
import java.util.List;

/**
 * Class maintains the list of violations in a file  
 */
public class FileViolations 
{
	private String filepath;
	private String fileType;
	private List<ReportViolation> violations = new ArrayList<ReportViolation>();
	
	public FileViolations(String filepath,String filetype) 
	{
		this.filepath = filepath;
		this.fileType = filetype;
	}
	
	public void addViolation(Violation violation,String linenum,String line)
	{
		ReportViolation reportViolation = new ReportViolation(violation,linenum);
		reportViolation.setLineContent(line);
		this.violations.add(reportViolation);
	}
	
	public void addViolation(ReportViolation reportViolation)
	{
		this.violations.add(reportViolation);
	}
	
	public String getFilePath()
	{
		return this.filepath;
	}
	
	public String getFileType()
	{
		return this.fileType;
	}
	
	public List<ReportViolation> getViolations()
	{
		return this.violations;
	}
}
